package com.company;

public class Car {
    //汽车属性
    public String car;
    public String CarColor;
    public   int CarSpeed;

    //setter和getter的接口

    public String getCar() {
        return car;
    }

    public String getCarColor() {
        return CarColor;
    }

    public int getCarSpeed() {
        return CarSpeed;
    }

    public void setCar(String car) {
        this.car = car;
    }

    public void setCarColor(String carColor) {
        CarColor = carColor;
    }

    public void setCarSpeed(int  carSpeed) {
        CarSpeed = carSpeed;
    }

    //构造方法
    public Car(String car,String CarColor,int CarSpeed){

        this.car=car;
        this.CarSpeed=CarSpeed;
        this.CarColor=CarColor;

        System.out.println(car+"---颜色是"+CarColor+"----车速是："+CarSpeed);
    }

    //车速的行为
    public  void Speed(){

        int CarSpeed = 80;

      if (CarSpeed >=60){
          System.out.println("车速"+CarSpeed+"车撞树了");
      }else {
          System.out.println("车速"+CarSpeed+"车正常运行");
      }
    }

}
